package model.micro.fieldunitabilities
{
	import model.micro.FieldUnit;
	import util.Settings;
	
	/**
	 */
	public class ChargeEffect extends FieldUnitAbilityEffect
	{
		private var time_remaining:Number;
		
		public function ChargeEffect(unit:FieldUnit)
		{
			super(unit);
			
			time_remaining = 5.0;
		}
		
		override public function update():void
		{
			super.update();
			
			time_remaining -= Settings.getTimeStep();
		}
		
		override public function readyToRemove():Boolean
		{
			return time_remaining <= 0;
		}
		
		override public function processSpeed(speed:Number):Number
		{
			return speed * 5;
		}
		
		public function toString():String
		{
			return "Charge (" + int(time_remaining + 1) + "s)";
		}
	}

}